<?php

namespace Admin;

use Zend_Auth_Adapter_DbTable;

class AuthAdapter extends Zend_Auth_Adapter_DbTable
{
    protected $_tableName = 'user';
    protected $_identityColumn = 'userName';
    protected $_credentialColumn = 'password';
    protected $_credentialTreatment = 'SHA1(CONCAT(?,salt))';

    protected function _authenticateCreateSelect()
    {
        $select = parent::_authenticateCreateSelect();
        $select->where('`role` = ?', Model::ADMIN);
        return $select;
    }
}
